<?php

namespace App\Transformers\Clbum;

use League\Fractal\TransformerAbstract;
use App\Models\Clbum\Clbum;

class ClbumTransformer extends TransformerAbstract
{

    public function transform(Clbum $model)
    {
        return [
            'id'         => (int) $model->id,
            'name'=>$model->name,
            'grade_id'=>$model->grade_id,
            'grade_name'=>$model->grade_name,
            'header_teacher_user_id'=>$model->header_teacher_user_id,
            'header_teacher_name'=>$model->header_teacher_name,
            'desc'=>$model->desc,
            'created_at' => $model->created_at->format('Y-m-d H:i:s'),
            'updated_at' => $model->updated_at->format('Y-m-d H:i:s')
        ];
    }
}
